<?php


namespace App\Models;

/**
 * 提现
 * 
 * Class CashApply
 *
 * @package App\Models
 * @property int $id
 * @property int $uid
 * @property string|null $name
 * @property string $type
 * @property string|null $cash_type
 * @property string|null $cardnum
 * @property string|null $bank_address
 * @property string|null $alipay_code
 * @property string|null $remark
 * @property string|null $balance
 * @property string|null $fail_msg
 * @property int|null $fail_time
 * @property int $status
 * @property string|null $weixin
 * @property string|null $real_name real_name
 * @property string|null $phone 提现审核的手机号
 * @property \Illuminate\Support\Carbon $created_at
 * @property \Illuminate\Support\Carbon $updated_at
 * @property int|null $deleted_at
 * @property string|null $bankname
 * @property string $order_ids
 * @property float $commission
 * @property string $order_no
 * @property string|null $openid
 * @property int $category
 * @property int $pay_type
 * @property int $role_id 所属角色id
 * @property int $role_type 所属角色
 * @property string|null $clock_pending_money 只当cash_type为clock才会>0
 * @property string|null $clock_slice 只当cash_type为clock才可能>0
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply query()
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereAlipayCode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereBalance($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereBankAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereBankname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereCardnum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereCashType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereCategory($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereClockPendingMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereClockSlice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereCommission($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereFailMsg($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereFailTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereOpenid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereOrderIds($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereOrderNo($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply wherePayType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereRealName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereRemark($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereRoleId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereRoleType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereUid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereUniacid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|CashApply whereWeixin($value)
 * @mixin \Eloquent
 * @property-read \App\Models\User $user
 */
class CashApply extends BaseModel
{
    protected $guarded = [];
    public $dateFormat = 'U';

    public static $statusEnum = [
        0 => '待打款',
        1 => '打款成功',
        -1 => '审核拒绝',
        -2 => '打款失败',
    ];
    /**
     * 提现方式
     * @var array
     */
    public static $typeEnum = [
        'weixin' => '微信',
        'alipay' => '支付宝',
        'bank' => '银行卡',
    ];

    /**
     * 支付方式
     * @var array
     */
    public static $payTypeEnum = [
        1 => '线下打款',
        2 => '线上打款',
    ];

    public function user()
    {
        return $this->belongsTo(User::class, 'uid', 'id');
    }
}